<?php
namespace app\admin\controller;

use app\admin\model\AdminRole;
use app\admin\model\MenuModel;
use think\Db;

class Test extends Base{
    public function index(){

        $data = MenuModel::order('sort','asc')->select()->toArray();
        $menu = MenuModel::getMenuTreeData( $data, 0 );
        $html = MenuModel::getSelectMenuTreeHtml( $menu );

        $this->assign('options', $html);

        return $this->fetch();
    }

    function test(){
       /* $data = array(
            'role_id' => 10,
        );
        $data['menu_auth'] = explode(',', '23,100,88');
//        $data['menu_auth'] = 14;
        $rows = AdminRole::update( $data );
        dump($rows->toArray());*/
       $res = AdminRole::getRoleMenuAuth('294');
       dump($res->toArray());


    }


}


